const path = require('path');

module.exports = {
  lintOnSave: false,
  chainWebpack: config => {
    config.resolve.alias.set('@', path.join(__dirname, './src'))
    config.plugin('define').tap(args => {
      args[0].BASE_API = JSON.stringify(process.env.BASE_API)
      return args
    })
  },
  devServer: {
    host: 'localhost',
    port: 8090,
    hot: true,
    open: true,
    overlay: {
      warnings: false,
      errors: true,
    },
    proxy: {
      '8090': {
        target: 'http://39.107.14.104:8081/', // 测试服
        changeOrigin: true,
      },
    },
  }
}